package com.tencent.smtt.sdk;

import android.content.Context;
import com.tencent.smtt.sdk.TbsDownloadConfig;
import com.tencent.smtt.utils.TbsLog;
import com.tencent.smtt.utils.m;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public final class ak implements m.a {
    final /* synthetic */ TbsDownloadConfig a;
    final /* synthetic */ boolean b;

    /* JADX INFO: Access modifiers changed from: package-private */
    public ak(TbsDownloadConfig tbsDownloadConfig, boolean z) {
        this.a = tbsDownloadConfig;
        this.b = z;
    }

    @Override // com.tencent.smtt.utils.m.a
    public void a(int i) {
        Context context;
        TbsDownloadConfig tbsDownloadConfig;
        int i2;
        TbsLog.i(TbsDownloader.LOGTAG, "[TbsDownloader.sendRequest] httpResponseCode=" + i);
        context = TbsDownloader.c;
        if (TbsShareManager.isThirdPartyApp(context) && i == 200) {
            this.a.a.put(TbsDownloadConfig.TbsConfigKey.KEY_LAST_REQUEST_SUCCESS, Long.valueOf(System.currentTimeMillis()));
            this.a.a.put(TbsDownloadConfig.TbsConfigKey.KEY_REQUEST_FAIL, 0L);
            this.a.a.put(TbsDownloadConfig.TbsConfigKey.KEY_COUNT_REQUEST_FAIL_IN_24HOURS, 0L);
            this.a.commit();
        }
        if (i >= 300) {
            if (this.b) {
                tbsDownloadConfig = this.a;
                i2 = -107;
            } else {
                tbsDownloadConfig = this.a;
                i2 = -207;
            }
            tbsDownloadConfig.setDownloadInterruptCode(i2);
        }
    }
}
